<?php
class Easyshopping{
	public function __construct(User $user){
		//load api functions if needed
		if(isset($_POST["api"])) new api($user);
		else{
			$xmlData = 
				"<root>".
					DomExtension::arrToXML($user->arrData, "user").
					file_get_contents(XML_DIR."testListTemplates.xml").
					file_get_contents(XML_DIR."testProductList.xml").
					file_get_contents(XML_DIR."testShoppingList.xml").
				"</root>";
			$domDoc = DomExtension::XSLTProcess(
				DOMDocument::loadXML($xmlData), 
				DOMDocument::load(XML_DIR."index.xsl")
			);
			echo $domDoc->saveXML();
		}
	}
}
class api{
	
}